<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML LANG="EN-US">
<HEAD>
<TITLE>VT100.net: VT330/VT340 Programmer Reference Manual</TITLE>
<LINK HREF="vt330.css" TYPE="text/css" REL="stylesheet">
</HEAD>
<BODY>
<DIV CLASS="navbar"><A HREF="http://vt100.net/"><IMG CLASS="button" SRC="vt100.net-logo.png" ALT="VT100.net" HEIGHT="16" WIDTH="102"></A> VT330/VT340 Programmer Reference Manual Volume 2: Graphics Programming<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="chapter8.html">Chapter 8</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="chapter10.html">Chapter 10</A></TD>
</TR>
</TBODY>
</TABLE>
<HR></DIV>
<H1 ID="S9"><SPAN CLASS="chapnum">9</SPAN> Macrographs</H1>
<H2 ID="S9.1">Macrographs: Storing Your Graphics</H2>
<P>Macrographs let you define and store commands used to draw graphics. For
example, you can store a logo as a series of commands in a macrograph, then
use the logo in different displays. You do not have to rebuild the logo each
time you need it. Macrographs are similar to procedures used in higher level
languages such as Pascal.</P>
<P>A macrograph can include ReGIS commands and character strings. The VT300
can store up to 26 macrographs. Each macrograph is identified by a letter of
the alphabet. The identifying letter is not case sensitive. (For example, 'a' and
'A' would identify the same macrograph.)</P>
<P>You can nest macrographs. That is, you can use one macrograph as part of
another macrograph. You can nest macrographs up to 16 levels deep. However,
a macrograph cannot call itself.</P>
<P>The VT300 can store at least 10,000 bytes of macrograph data. Macrograph
data is stored dynamically. When you redefine or delete a macrograph, the terminal
clears the old data.</P>
<P>The VT300 does not draw macrographs when you define them. You must select
a defined macrograph to draw it. Selecting an empty macrograph does not
cause an error. The macrograph saves all characters it contains, including
the four control characters BS, HT, CR, and LF.</P>
<P>You can define macrographs at almost any point in a ReGIS stream, with the
following exceptions.</P>
<UL>
<LI><P><STRONG>As part of a quoted string</STRONG><BR>
ReGIS does not recognize any commands in a quoted text string. If
you try to define a macrograph in a text string, ReGIS interprets
the command as text to display on the screen.</P></LI>
<LI><P><STRONG>In another macrograph</STRONG><BR>
You must define macrographs separately. You cannot define a
macrograph while inside another macrograph. You cannot nest
macrograph definitions.</P></LI>
</UL>
<P>There are three types of macrograph command operations.</P>
<UL>
<LI>Define macrograph</LI>
<LI>Invoke macrograph</LI>
<LI>Clear macrographs</LI>
</UL>
<P CLASS="note">PROGRAMMING TIP: Macrographs can store parts of commands that you
use frequently in a program. For example, you can store the parameters for
several color maps in a macrograph.</P>
<H2 ID="S9.2">Define Macrograph</H2>
<P>You use this option to define a macrograph and assign it a letter. You use the
following format for the define macrograph operation.</P>
<P CLASS="example">@:&lt;call letter&gt;&lt;definition&gt;@;</P>
<P>where</P>
<DIV CLASS="example"><P><B>@</B> identifies the beginning of a macrograph definition.</P>
<P><B>:</B> identifies a define macrograph operation.</P>
<P><B>&lt;call letter&gt;</B> is a letter of the alphabet used to identify the macrograph
you are defining. The call letter is case insensitive. For example, 'a' and
'A' identify the same macrograph.</P>
<P><B>&lt;definition&gt;</B> is the macrograph's definition.</P>
<P><B>@;</B> identifies the end of the definition.</P></DIV>
<P><A HREF="#F9-1">Figure 9-1</A> shows an example of how to define, store, and invoke the
macrograph for a shaded star.</P>
<TABLE ID="F9-1" CLASS="figure" WIDTH="100%">
<CAPTION>Figure 9-1 Macrograph Example</CAPTION>
<COL ALIGN="CENTER">
<TBODY>
<TR>
<TD><IMG SRC="ma-0735-83r.png" ALT=""></TD>
</TR>
<TR>
<TD><TABLE CLASS="command-example" FRAME="BORDER" RULES="GROUPS" CELLSPACING="0" CELLPADDING="8">
<TBODY>
<TR>
<TD ALIGN="CENTER">COMMANDS</TD>
</TR>
</TBODY>
<TBODY>
<TR VALIGN="TOP">
<TD>@:S<BR>W(S1)<BR>P[+50,+50]<BR>V[-100]<BR>[-100,-50]<BR>[+100]<BR>[+50,-100]<BR>
[+50,+100]<BR>[+100]<BR>[-100,+50]<BR>P[+50,+125]<BR>W(S1)<BR>V[-50,-125]<BR>[-100]<BR>
[-50,+125]<BR>W(I0)<BR>V[+100,-75]<BR>[+100,+75]<BR>@;<BR>P[200,200]<BR>W(I2)<BR>
@S<BR>W(I1)<BR>P[400,150]<BR>@S<BR>W(I2)<BR>P[600,200]<BR>@S</TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S9.3">Invoke Macrograph</H2>
<P>This option lets you select a macrograph that you already defined. For example,
if you stored a graphic image with a macrograph, you can display the image
with this option. ReGIS inserts the contents of the macrograph into the
command stream. You use the following format for the invoke macrograph
option.</P>
<P CLASS="example">@&lt;call letter&gt;</P>
<P>where</P>
<P CLASS="example"><B>&lt;call letter&gt;</B> is the letter of the alphabet that identifies the macrograph
you want to use. The letter is not case sensitive. For example, 'a' and 'A'
identify the same macrograph.</P>
<P>When you select a macrograph, ReGIS uses the current values for commands
such as write, screen, and text commands. You can select new values in the
definition for a macrograph, by using the ReGIS commands and temporary options.</P>
<H2 ID="S9.4">Clear Macrograph</H2>
<P>There are two options for clearing macrograph definitions.</P>
<TABLE CLASS="dpadded">
<TBODY>
<TR VALIGN="TOP">
<TD>Clear all macrographs</TD>
<TD>Clears the definitions in all 26 macrograph locations.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Clear specified macrograph</TD>
<TD>Clears the macrograph that you identify by letter.</TD>
</TR>
</TBODY>
</TABLE>
<P>You use the following formats for the clear macrograph options.</P>
<DIV CLASS="example"><TABLE CLASS="padded">
<THEAD>
<TR>
<TH CLASS="first">Clear All Macrographs</TH>
<TH>Clear Specified Macrograph</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD CLASS="first">@.</TD>
<TD>@:&lt;call letter&gt;@;</TD>
</TR>
</TBODY>
</TABLE></DIV>
<P>where</P>
<DIV CLASS="example"><P><B>@.</B> is the command for clearing all 26 macrographs.</P>
<P><B>@:</B> identifies a define macrograph operation.</P>
<P><B>&lt;call letter&gt;</B> specifies the macrograph you want to clear.</P>
<P><B>@;</B> clears the selected macrographs by specifying a blank definition.</P></DIV>
<H2 ID="S9.5">Macrograph Summary</H2>
<P><A HREF="#T9-1">Table 9-1</A> is a summary of the macrograph options. There are no default values
for these commands.</P>
<TABLE ID="T9-1" CLASS="summarytable" FRAME="VOID" RULES="GROUPS" CELLSPACING="0" CELLPADDING="4">
<CAPTION>Table 9-1 Macrograph Summary</CAPTION>
<COL SPAN="2" WIDTH="50%">
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Option</TH>
<TH>Description</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>@&lt;call letter&gt;</TD>
<TD><P><STRONG>Invoke macrograph</STRONG><BR>
Inserts the contents of the macrograph specified by &lt;call letter&gt; into the ReGIS command string. The &lt;call letter&gt; is not case sensitive.</P></TD>
</TR>
<TR VALIGN="TOP">
<TD>@:&lt;call letter&gt; &lt;definition&gt;@;</TD>
<TD><P><STRONG>Define macrograph</STRONG><BR>
Defines a macrograph and selects &lt;call letter&gt; to identify the macrograph.
The &lt;call letter&gt; is not case sensitive.</P></TD>
</TR>
<TR VALIGN="TOP">
<TD>@.</TD>
<TD><P><STRONG>Clear all macrographs</STRONG><BR>
Deletes all macrograph definitions.</P></TD>
</TR>
<TR VALIGN="TOP">
<TD>@:&lt;call letter&gt;@;</TD>
<TD><P><STRONG>Clear defined macrograph</STRONG><BR>
Deletes the macrograph identified by &lt;call letter&gt;.</P></TD>
</TR>
</TBODY>
</TABLE>
<DIV CLASS="navbar"><HR>
<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="chapter8.html">Chapter 8</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="chapter10.html">Chapter 10</A></TD>
</TR>
</TBODY>
</TABLE>
<DIV CLASS="navbot">http://vt100.net/docs/vt3xx-gp/chapter9.html</DIV></DIV>
</BODY>
</HTML>
